function mpc = case_aspete_MV_monte_carlo_RES(MC,PV)
%   CASE_ASPETE_MV Power flow data for a 100 nodes distribution line.
%
%   Based on data of the Hellenic Distribution system

%   MATPOWER

%   PVs are simulated as negative loads, power/100kWp
Ppv=-PV;

%% MATPOWER Case Format : Version 1
mpc.version = '2';

%%-----  Power Flow Data  -----%%
%% system MVA base
mpc.baseMVA = 10;

%% bus data
%	bus_i	type	Pd	Qd	Gs	Bs	area	Vm	Va	baseKV	zone	Vmax	Vmin
mpc.bus = [
	1	3	0	0	0	0	1	1	0	20	1	1.1	0.9;
    2	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    28	1	0.017*MC(1)	0.010*MC(1)	0	0	1	1	0	20	1	1.1	0.9;
    31	1	0.164*MC(2)	0.102*MC(2)	0	0	1	1	0	20	1	1.1	0.9;
    
    39	1	0.243*MC(3)	0.151*MC(3)	0	0	1	1	0	20	1	1.1	0.9;
    3918	1	0.504*MC(4)	0.312*MC(4)	0	0	1	1	0	20	1	1.1	0.9;
    3951	1	0.034*MC(5)	0.021*MC(5)	0	0	1	1	0	20	1	1.1	0.9;
    3994	1	0.122*MC(6)	0.075*MC(6)	0	0	1	1	0	20	1	1.1	0.9;
    39513	1	0.017*MC(7)	0.010*MC(7)	0	0	1	1	0	20	1	1.1	0.9;
    9067	1	Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    
    45	1	0.034*MC(8)	0.021*MC(8)	0	0	1	1	0	20	1	1.1	0.9;
    451	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    4516	1	0.274*MC(9)	0.170*MC(9)	0	0	1	1	0	20	1	1.1	0.9;
    4514	1	0.034*MC(10)	0.021*MC(10)	0	0	1	1	0	20	1	1.1	0.9;
    
    49	1	0.108*MC(11)	0.067*MC(11)	0	0	1	1	0	20	1	1.1	0.9;
    499	1	0.139*MC(12)	0.086*MC(12)	0	0	1	1	0	20	1	1.1	0.9;
    
    61	1	0.311*MC(13)	0.193*MC(13)	0	0	1	1	0	20	1	1.1	0.9;
    615	1	0.025*MC(14)	0.016*MC(14)	0	0	1	1	0	20	1	1.1	0.9;
    616	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    6166	1	0.189*MC(15)	0.117*MC(15)	0	0	1	1	0	20	1	1.1	0.9;
    617	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    6172	1	0.085*MC(16)	0.052*MC(16)	0	0	1	1	0	20	1	1.1	0.9;
    6178	1	0.059*MC(17)	0.037*MC(17)	0	0	1	1	0	20	1	1.1	0.9;
    61721	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    61722	1	0.085*MC(18)	0.052*MC(18)	0	0	1	1	0	20	1	1.1	0.9;
    617212	1	0.139*MC(19)	0.086*MC(19)	0	0	1	1	0	20	1	1.1	0.9;
    902	1	Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    9022	1	Ppv	0	0	0	1	1	0	20	1	1.1	0.9;

    6110	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    61106	1	0.034*MC(20)	0.021*MC(20)	0	0	1	1	0	20	1	1.1	0.9;
    6111	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    90178	1	Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    6115	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    61156	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    9070	1	Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    9071	1	Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    6122	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    9069	1	Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    6128	1	0.034*MC(21)	0.021*MC(21)	0	0	1	1	0	20	1	1.1	0.9;
    61289	1	0.054*MC(22)	0.034*MC(22)	0	0	1	1	0	20	1	1.1	0.9;
    6132	1	0	0	0	0	1	1	0	20	1	1.1	0.9;

    61323	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    613216	1	0.017*MC(23)	0.010*MC(23)	0	0	1	1	0	20	1	1.1	0.9;
    90137	1	Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    613231	1	0.068*MC(24)	0.042*MC(24)	0	0	1	1	0	20	1	1.1	0.9;
    6132162	1	0.184*MC(25)	0.114*MC(25)	0	0	1	1	0	20	1	1.1	0.9;
    6132311	1	0.034*MC(26)	0.021*MC(26)	0	0	1	1	0	20	1	1.1	0.9;
    90112	1	Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    
    6133	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    6142	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    61429	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    90700	1	7*Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    90470	1	4.7*Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    6145	1	0.071*MC(27)	0.044*MC(27)	0	0	1	1	0	20	1	1.1	0.9;
    61454	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    614541	1	0.034*MC(28)	0.021*MC(28)	0	0	1	1	0	20	1	1.1	0.9;
    614512	1	0.017*MC(29)	0.010*MC(29)	0	0	1	1	0	20	1	1.1	0.9;
    
    68	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    683	1	0.054*MC(30)	0.034*MC(30)	0	0	1	1	0	20	1	1.1	0.9;
    90259	1	Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    
    74	1	0.051*MC(31)	0.031*MC(31)	0	0	1	1	0	20	1	1.1	0.9;
    7414	1	0.034*MC(32)	0.021*MC(32)	0	0	1	1	0	20	1	1.1	0.9;
    74146	1	0.054*MC(33)	0.034*MC(33)	0	0	1	1	0	20	1	1.1	0.9;
    90288	1	Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    80	1	0.223*MC(34)	0.138*MC(34)	0	0	1	1	0	20	1	1.1	0.9;
    87	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    873	1	0.054*MC(35)	0.034*MC(35)	0	0	1	1	0	20	1	1.1	0.9;
    90210	1	Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    8731	1	0.085*MC(36)	0.052*MC(36)	0	0	1	1	0	20	1	1.1	0.9;
    90168	1	Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    89	1	0.025*MC(37)	0.016*MC(37)	0	0	1	1	0	20	1	1.1	0.9;
    91	1	0.034*MC(38)	0.021*MC(38)	0	0	1	1	0	20	1	1.1	0.9;
    9014	1	5*Ppv	0	0	0	1	1	0	20	1	1.1	0.9;

    92	1	0.085*MC(39)	0.052*MC(39)	0	0	1	1	0	20	1	1.1	0.9;
    95	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    928	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    9281	1	0.017*MC(40)	0.010*MC(40)	0	0	1	1	0	20	1	1.1	0.9;
    9213	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    9059	1	Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    9214	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    9015	1	5*Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    9218	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    9017822	1	0.2*Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    92181	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    92187	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    9011	1	Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    921810	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    9013	1	Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    921826	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    9090	1	12.74*Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
    9091	1	18.15*Ppv	0	0	0	1	1	0	20	1	1.1	0.9;

    9221	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    92214	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    922143	1	0.054*MC(41)	0.034*MC(41)	0	0	1	1	0	20	1	1.1	0.9;
    922110	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    922166	1	0.085*MC(42)	0.052*MC(42)	0	0	1	1	0	20	1	1.1	0.9;
    92211	1	0.034*MC(43)	0.021*MC(43)	0	0	1	1	0	20	1	1.1	0.9;
    9230	1	0	0	0	0	1	1	0	20	1	1.1	0.9;
    9240	1	0.054*MC(44)	0.034*MC(44)	0	0	1	1	0	20	1	1.1	0.9;
    92301	1	0.054*MC(45)	0.034*MC(45)	0	0	1	1	0	20	1	1.1	0.9;
    90263	1	0.5*Ppv	0	0	0	1	1	0	20	1	1.1	0.9;
];

%% generator data
%	bus	Pg	Qg	Qmax	Qmin	Vg	mBase	status	Pmax	Pmin	Pc1	Pc2	Qc1min	Qc1max	Qc2min	Qc2max	ramp_agc	ramp_10	ramp_30	ramp_q	apf
mpc.gen = [
           1	0	0	100	-100	1	10	1	1	0	0	0	0	0	0	0	0	0	0	0	0;
           ];

%% branch data
%	fbus	tbus	r	x	b	rateA	rateB	rateC	ratio	angle	status	angmin	angmax
mpc.branch = [
    1	2	0.00005375	0.0000835	0	0	0	0	0	0	1	-360	360;
    2	28	0.12389375	0.1924675	0	0	0	0	0	0	1	-360	360;
	28	31	0.0134375	0.020875	0	0	0	0	0	0	1	-360	360;
	31	39	0.02623	0.040748	0	0	0	0	0	0	1	-360	360;
	
    39	3918	0.25302375	0.09284625	0	0	0	0	0	0	1	-360	360;
    3918	3951	0.64768725	0.23766675	0	0	0	0	0	0	1	-360	360;
    3951	3994	0.83671875	0.30703125	0	0	0	0	0	0	1	-360	360;
    3951	39513	0.0690795	0.0253485	0	0	0	0	0	0	1	-360	360;
    39513	9067	0.037485	0.013755	0	0	0	0	0	0	1	-360	360;

    39	45	0.02714375	0.0421675	0	0	0	0	0	0	1	-360	360;
    45	451	0.041844	0.013926	0	0	0	0	0	0	1	-360	360;
    451	4516	0.276107	0.0918905	0	0	0	0	0	0	1	-360	360;
    451	4514	0.04438	0.01477	0	0	0	0	0	0	1	-360	360;

    45	49	0.01789875	0.0278055	0	0	0	0	0	0	1	-360	360;
    49	499	0.149941	0.0499015	0	0	0	0	0	0	1	-360	360;
    49	61	0.05375	0.0835	0	0	0	0	0	0	1	-360	360;
    
    61	615	0.026875	0.04175	0	0	0	0	0	0	1	-360	360;
    615	616	0.005375	0.00835	0	0	0	0	0	0	1	-360	360;
    616	6166	0.205416	0.068364	0	0	0	0	0	0	1	-360	360;
    616	617	0.005375	0.00835	0	0	0	0	0	0	1	-360	360;
    617	6172	0.05706	0.01899	0	0	0	0	0	0	1	-360	360;
    6172	6178	0.166108	0.055282	0	0	0	0	0	0	1	-360	360;
    6172	61721	0.053573	0.0178295	0	0	0	0	0	0	1	-360	360;
    61721	61722	0.004438	0.001477	0	0	0	0	0	0	1	-360	360;
    61721	617212	0.06974	0.02321	0	0	0	0	0	0	1	-360	360;
    617212	902	0.0187425	0.0068775	0	0	0	0	0	0	1	-360	360;
    617212	9022	0.0530145	0.0194535	0	0	0	0	0	0	1	-360	360;

    617	6110	0.01634	0.025384	0	0	0	0	0	0	1	-360	360;
    6110	61106	0.098587	0.0328105	0	0	0	0	0	0	1	-360	360;
    6110	6111	0.005805	0.009018	0	0	0	0	0	0	1	-360	360;
    6111	6115	0.12557475	0.04607925	0	0	0	0	0	0	1	-360	360;
    6111	90178	0.07416675	0.02721525	0	0	0	0	0	0	1	-360	360;
    6115	61156	0.12450375	0.04568625	0	0	0	0	0	0	1	-360	360;
    61156	9070	0.0797895	0.0292785	0	0	0	0	0	0	1	-360	360;
    61156	9071	0.00026775	0.00009825	0	0	0	0	0	0	1	-360	360;
    6115	6122	0.03552875	0.0551935	0	0	0	0	0	0	1	-360	360;
    6122	9069	0.133875	0.049125	0	0	0	0	0	0	1	-360	360;
    6122	6128	0.02402625	0.0373245	0	0	0	0	0	0	1	-360	360;
    6128	61289	0.103342	0.034393	0	0	0	0	0	0	1	-360	360;
    6128	6132	0.01843625	0.0286405	0	0	0	0	0	0	1	-360	360;

    6132	61323	0.0951	0.03165	0	0	0	0	0	0	1	-360	360;
    61323	613216	0.404175	0.1345125	0	0	0	0	0	0	1	-360	360;
    613216	90137	0.00615825	0.00225975	0	0	0	0	0	0	1	-360	360;
    613216	613231	0.432705	0.1440075	0	0	0	0	0	0	1	-360	360;
    613231	6132162	3.227377	1.0740955	0	0	0	0	0	0	1	-360	360;
    613231	6132311	0.0273105	0.0100215	0	0	0	0	0	0	1	-360	360;
    6132311	90112	0.00026775	0.00009825	0	0	0	0	0	0	1	-360	360;

    6132	6133	0.0044075	0.006847	0	0	0	0	0	0	1	-360	360;
    6133	6142	0.20804175	0.07634025	0	0	0	0	0	0	1	-360	360;
    6142	61429	0.1879605	0.0689715	0	0	0	0	0	0	1	-360	360;
    61429	90470	0.020349	0.007467	0	0	0	0	0	0	1	-360	360;
    61429	90700	0.1108485	0.0406755	0	0	0	0	0	0	1	-360	360;
    6142	6145	0.0765765	0.0280995	0	0	0	0	0	0	1	-360	360;
    6145	61454	0.12932325	0.04745475	0	0	0	0	0	0	1	-360	360;
    61454	614512	0.18126675	0.06651525	0	0	0	0	0	0	1	-360	360;
    61454	614541	0.004438	0.001477	0	0	0	0	0	0	1	-360	360;

    61	68	0.0295625	0.045925	0	0	0	0	0	0	1	-360	360;
    68	683	0.00962125	0.0149465	0	0	0	0	0	0	1	-360	360;
    68	90259	0.018207	0.006681	0	0	0	0	0	0	1	-360	360;
    68	74	0.0130075	0.020207	0	0	0	0	0	0	1	-360	360;
    
    74	7414	0.115071	0.0382965	0	0	0	0	0	0	1	-360	360;
    7414	74146	0.160719	0.0534885	0	0	0	0	0	0	1	-360	360;
    7414	90288	0.002142	0.000786	0	0	0	0	0	0	1	-360	360;
    74	80	0.02800375	0.0435035	0	0	0	0	0	0	1	-360	360;
    80	87	0.03225	0.0501	0	0	0	0	0	0	1	-360	360;
    87	873	0.071325	0.0237375	0	0	0	0	0	0	1	-360	360;
    873	90210	0.0026775	0.0009825	0	0	0	0	0	0	1	-360	360;
    873	8731	0.0026775	0.0009825	0	0	0	0	0	0	1	-360	360;
    8731	90168	0.0026775	0.0009825	0	0	0	0	0	0	1	-360	360;
    87	89	0.01058875	0.0164495	0	0	0	0	0	0	1	-360	360;
    89	91	0.01118	0.017368	0	0	0	0	0	0	1	-360	360;
    91	9014	0.002142	0.000786	0	0	0	0	0	0	1	-360	360;
    91	92	0.0003225	0.000501	0	0	0	0	0	0	1	-360	360;
    92	95	0.0179525	0.027889	0	0	0	0	0	0	1	-360	360;
    
    92	928	0.21018375	0.07712625	0	0	0	0	0	0	1	-360	360;
    928	9281	0.005706	0.001899	0	0	0	0	0	0	1	-360	360;
    928	9213	0.12075525	0.04431075	0	0	0	0	0	0	1	-360	360;
    9213	9059	0.13039425	0.04784775	0	0	0	0	0	0	1	-360	360;
    9213	9214	0.01151325	0.00422475	0	0	0	0	0	0	1	-360	360;
    9214	9015	0.03346875	0.01228125	0	0	0	0	0	0	1	-360	360;
    9214	9218	0.12825225	0.04706175	0	0	0	0	0	0	1	-360	360;
    9218	9017822	0.095319	0.034977	0	0	0	0	0	0	1	-360	360;
    9218	92181	0.0026775	0.0009825	0	0	0	0	0	0	1	-360	360;
    92181	92187	0.15288525	0.05610075	0	0	0	0	0	0	1	-360	360;
    92187	9011	0.0016065	0.0005895	0	0	0	0	0	0	1	-360	360;
    92187	921810	0.065331	0.023973	0	0	0	0	0	0	1	-360	360;
    921810	9013	0.0058905	0.0021615	0	0	0	0	0	0	1	-360	360;
    921810	921826	0.370566	0.135978	0	0	0	0	0	0	1	-360	360;
    921826	9090	0.02008125	0.00736875	0	0	0	0	0	0	1	-360	360;
    921826	9091	0.34727175	0.12743025	0	0	0	0	0	0	1	-360	360;

    92181	9221	0.084322	0.028063	0	0	0	0	0	0	1	-360	360;
    9221	92214	0.1268	0.0422	0	0	0	0	0	0	1	-360	360;
    92214	922143	0.072276	0.024054	0	0	0	0	0	0	1	-360	360;
    92214	922110	0.1902	0.0633	0	0	0	0	0	0	1	-360	360;
    922110	922166	1.574856	0.524124	0	0	0	0	0	0	1	-360	360;

    9221	92211	0.01902	0.00633	0	0	0	0	0	0	1	-360	360;
    92211	9230	0.113803	0.0378745	0	0	0	0	0	0	1	-360	360;
    9230	92301	0.002219	0.0007385	0	0	0	0	0	0	1	-360	360;
    92301	90263	0.0026775	0.0009825	0	0	0	0	0	0	1	-360	360;
    9230	9240	0.116656	0.038824	0	0	0	0	0	0	1	-360	360;
              
    6133    921810  0.43    0.668    0    0    0    0    0    0    1    -360    360;
];
